package com.lt.tccdemo.controller;

import com.lt.tccdemo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lucine
 * @version 1.0 2021/10/5 18:04
 */
@RestController
public class OrderController {

    @Autowired
    private OrderService orderService;

    @RequestMapping("handleOrder")
    public String handleOrder(int orderId){
        try {
            int i = orderService.handlerOrder(orderId);
            if(i==0){
                return "success";
            }
            return "fail";
        }catch (Exception e){
            return "fail";
        }
    }

}
